﻿var SAGhoul = importNamespace("SAGhoul");

function boss(name)
{
    findSubsystem("Players").ComponentPlayers.forEach((player) =>
    {
        player.Entity.FindComponent("SAGPlayer", false).SpawnBoss(name);
    });
    return name + " is coming!";
}
function setday(day)
{
    findSubsystem("GameInfo").TotalElapsedGameTime = day * findSubsystem("TimeOfDay").DayDuration;
    findSubsystem("TimeOfDay").TimeOfDayOffset = 0;
    return "Day set to " + day;
}
function sagclear()
{
    SAGhoul.SAGhoulsManager.SAGClear(getProject());
    return "Clear all ghouls and pickables";
}
function transportal()
{
    findSubsystem("Tartareosity").TransPortal();
}
function cass(slot)
{
    slot = (typeof slot === 'undefined' || Number.isNaN(slot)) ? 0 : slot;
    slot = Math.min(Math.max(slot, 0), 3)
    var r = SAGhoul.SAGhoulsManager.CalculateArmorSlotSturdiness(getCommandingPlayer().ComponentClothing, slot);
    return `cass=${r}`;
}
function alv4()
{
    SAGhoul.SAGhoulsManager.SpawnAquagazeLv4(getCommandingPlayer());
    return 'Spawn "Aquagaze" Lv4.'
}
